<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>js计算二维数组平均值</title>
</head>
<script type="text/javascript">
	var arr = [[89,778,65],[66,43,123,24345,14]];

	var sum = 0;

	var num = 0 ;


	for(var i=0; i<arr.length;i++){

		num += arr[i].length;

		for(var j=0; j<arr[i].length;j++){

			sum += arr[i][j];

		}
	}
	window.alert(num);
	window.alert(sum);
	window.alert(sum/num);
</script>
<body>
	
</body>
</html>